//*****************************************************************************
//
// myAccel3LV02.h - Definitions for myAccel3LV02 accelerometer sensor module.
//
// Copyright (c) 2003-2010 Withrobot, Inc.  All rights reserved.
//
// Software License Agreement
//
// Withrobot, Inc.(Withrobot) is supplying this software for use solely and
// exclusively on Withrobot's products.
//
// The software is owned by Withrobot and/or its suppliers, and is protected
// under applicable copyright laws.  All rights are reserved.
// Any use in violation of the foregoing restrictions may subject the user
// to criminal sanctions under applicable laws, as well as to civil liability
// for the breach of the terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// WITHROBOT SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
// OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of myCortex-LMXXXX series examples.
//*****************************************************************************

#ifndef MYACCEL3LV02_H_
#define MYACCEL3LV02_H_

#define MA3_REG_WHO_AM_I				0x12
#define MA3_REG_STATUS					0x13
#define MA3_REG_REV_ID					0x14
#define MA3_REG_ACC_X_L					0x32
#define MA3_REG_ACC_X_H					0x33
#define MA3_REG_ACC_Y_L					0x34
#define MA3_REG_ACC_Y_H					0x35
#define MA3_REG_ACC_Z_L					0x36
#define MA3_REG_ACC_Z_H					0x37


// bit mask for CTRL_REG1
#define MA3_CTRL_REG1_PD1				0x80
#define MA3_CTRL_REG1_PD0				0x40
#define MA3_CTRL_REG1_DF1				0x20
#define MA3_CTRL_REG1_DF0				0x10
#define MA3_CTRL_REG1_ST				0x08
#define MA3_CTRL_REG1_ZEN				0x04
#define MA3_CTRL_REG1_YEN				0x02
#define MA3_CTRL_REG1_XEN				0x01

#define MA3_CTRL_REG2_FS				0x80
#define MA3_CTRL_REG2_BDU				0x40
#define MA3_CTRL_REG2_BLE				0x20
#define MA3_CTRL_REG2_BOOT				0x10
#define MA3_CTRL_REG2_IEN				0x08
#define MA3_CTRL_REG2_DRDY				0x04
#define MA3_CTRL_REG2_SIM				0x02
#define MA3_CTRL_REG2_DAS				0x01

#define MA3_CTRL_REG3_ECK				0x80
#define MA3_CTRL_REG3_HPDD				0x40
#define MA3_CTRL_REG3_HPFF				0x20
#define MA3_CTRL_REG3_FDS				0x10
#define MA3_CTRL_REG3_CFS1				0x02
#define MA3_CTRL_REG3_CFS0				0x01

#define MA3_STATUS_REG_ZYXOR			0x80
#define MA3_STATUS_ERG_ZOR				0x40
#define MA3_STATUS_ERG_YOR				0x20
#define MA3_STATUS_ERG_XOR				0x10
#define MA3_STATUS_ERG_ZYXDA			0x08
#define MA3_STATUS_ERG_ZDA				0x04
#define MA3_STATUS_ERG_YDA				0x02
#define MA3_STATUS_ERG_XDA				0x01

#define MA3_FF_WU_CFG_AOI				0x80
#define MA3_FF_WU_CFG_LIR				0x40
#define MA3_FF_WU_CFG_ZHIE				0x20
#define MA3_FF_WU_CFG_ZLIE				0x10
#define MA3_FF_WU_CFG_YHIE				0x08
#define MA3_FF_WU_CFG_YLIE				0x04
#define MA3_FF_WU_CFG_XHIE				0x02
#define MA3_FF_WU_CFG_XLIE				0x01

#define MA3_FF_WU_SRC_IA				0x40
#define MA3_FF_WU_SRC_ZH				0x20
#define MA3_FF_WU_SRC_ZL				0x10
#define MA3_FF_WU_SRC_YH				0x08
#define MA3_FF_WU_SRC_YL				0x04
#define MA3_FF_WU_SRC_XH				0x02
#define MA3_FF_WU_SRC_XL				0x01

#define MA3_DD_CFG_IEND					0x80
#define MA3_DD_CFG_LIR					0x40
#define MA3_DD_CFG_ZHIE					0x20
#define MA3_DD_CFG_ZLIE					0x10
#define MA3_DD_CFG_YHIE					0x08
#define MA3_DD_CFG_YLIE					0x04
#define MA3_DD_CFG_XHIE					0x02
#define MA3_DD_CFG_XLIE					0x01

#define MA3_DD_SRC_IA					0x40
#define MA3_DD_SRC_ZH					0x20
#define MA3_DD_SRC_ZL					0x10
#define MA3_DD_SRC_YH					0x08
#define MA3_DD_SRC_YL					0x04
#define MA3_DD_SRC_XH					0x02
#define MA3_DD_SRC_XL					0x01


#endif /*MYACCEL3LV02_H_*/
